<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
<HEAD>
<TITLE>terminal_interface-curses-forms-field_types-user-choice.adb</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
*.comment {
	color: green;
}
*.symbol {
	color: red;
}
</style>
</HEAD>
<BODY>
<HR><DIV style="text-align:center"><H1> File : terminal_interface-curses-forms-field_types-user-choice.adb </H1></DIV><HR>
<PRE>
<span class="comment"><EM>------------------------------------------------------------------------------</EM></span>
<span class="comment"><EM>--                                                                          --</EM></span>
<span class="comment"><EM>--                           <A HREF="http://www.gnat.com">GNAT</A> ncurses Binding                           --</EM></span>
<span class="comment"><EM>--                                                                          --</EM></span>
<span class="comment"><EM>--          Terminal_Interface.Curses.Forms.Field_Types.User.Choice         --</EM></span>
<span class="comment"><EM>--                                                                          --</EM></span>
<span class="comment"><EM>--                                 B O D Y                                  --</EM></span>
<span class="comment"><EM>--                                                                          --</EM></span>
<span class="comment"><EM>------------------------------------------------------------------------------</EM></span>
<span class="comment"><EM>-- Copyright 2020 Thomas E. Dickey                                          --</EM></span>
<span class="comment"><EM>-- Copyright 1999-2011,2014 Free Software Foundation, Inc.                  --</EM></span>
<span class="comment"><EM>--                                                                          --</EM></span>
<span class="comment"><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></span>
<span class="comment"><EM>-- copy of this software and associated documentation files (the            --</EM></span>
<span class="comment"><EM>-- "Software"), to deal in the Software without restriction, including      --</EM></span>
<span class="comment"><EM>-- without limitation the rights to use, copy, modify, merge, publish,      --</EM></span>
<span class="comment"><EM>-- distribute, distribute with modifications, sublicense, and/or sell       --</EM></span>
<span class="comment"><EM>-- copies of the Software, and to permit persons to whom the Software is    --</EM></span>
<span class="comment"><EM>-- furnished to do so, subject to the following conditions:                 --</EM></span>
<span class="comment"><EM>--                                                                          --</EM></span>
<span class="comment"><EM>-- The above copyright notice and this permission notice shall be included  --</EM></span>
<span class="comment"><EM>-- in all copies or substantial portions of the Software.                   --</EM></span>
<span class="comment"><EM>--                                                                          --</EM></span>
<span class="comment"><EM>-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --</EM></span>
<span class="comment"><EM>-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --</EM></span>
<span class="comment"><EM>-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --</EM></span>
<span class="comment"><EM>-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --</EM></span>
<span class="comment"><EM>-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --</EM></span>
<span class="comment"><EM>-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --</EM></span>
<span class="comment"><EM>-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --</EM></span>
<span class="comment"><EM>--                                                                          --</EM></span>
<span class="comment"><EM>-- Except as contained in this notice, the name(s) of the above copyright   --</EM></span>
<span class="comment"><EM>-- holders shall not be used in advertising or otherwise to promote the     --</EM></span>
<span class="comment"><EM>-- sale, use or other dealings in this Software without prior written       --</EM></span>
<span class="comment"><EM>-- authorization.                                                           --</EM></span>
<span class="comment"><EM>------------------------------------------------------------------------------</EM></span>
<span class="comment"><EM>--  Author:  Juergen Pfeifer, 1996</EM></span>
<span class="comment"><EM>--  Version Control:</EM></span>
<span class="comment"><EM>--  @Revision: 1.21 @</EM></span>
<span class="comment"><EM>--  @Date: 2020/02/02 23:34:34 @</EM></span>
<span class="comment"><EM>--  Binding Version 01.00</EM></span>
<span class="comment"><EM>------------------------------------------------------------------------------</EM></span>
<b>with</b> System.Address_To_Access_Conversions;
<b>with</b> <A HREF="terminal_interface__ads.htm#ref_43_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_48_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_46_35">Aux</A>; <b>use</b> <A HREF="terminal_interface__ads.htm#ref_43_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_48_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_46_35">Aux</A>;

<b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#ref_43_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_48_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_46_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_45_41">Field_Types</A>.<A HREF="terminal_interface-curses-forms-field_types-user__ads.htm#ref_45_53">User</A>.<span class="symbol"><A NAME="ref_46_63" HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_45_58">Choice</A></span> <b>is</b>

   <b>package</b> Argument_Conversions <b>is</b>
      <b>new</b> System.Address_To_Access_Conversions (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_212_9">Argument</A>);

   <b>function</b> <span class="symbol"><A NAME="ref_51_13" HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_81_13">Generic_Next</A></span> (<span class="symbol"><A NAME="ref_51_27" HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_81_27">Fld</A></span> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_52_9">Field</A>;
                          <span class="symbol"><A NAME="ref_52_27" HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_82_27">Usr</A></span> : System.Address) <b>return</b> <A HREF="terminal_interface-curses__ads.htm#ref_2099_9">Curses_Bool</A>
   <b>is</b>
      <span class="symbol"><A NAME="ref_54_7">Result</A></span> : Boolean;
      <span class="symbol"><A NAME="ref_55_7">Udf</A></span>    : <b>constant</b> <A HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_58_9">User_Defined_Field_Type_With_Choice_Access</A> :=
        <A HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_58_9">User_Defined_Field_Type_With_Choice_Access</A>
        (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_217_9">Argument_Access</A> (Argument_Conversions.To_Pointer (<A HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_82_27">Usr</A>)).<b>all</b>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_213_7">Typ</A>);
   <b>begin</b>
      <A HREF="terminal_interface-curses-forms-field_types-user-choice__adb.htm#ref_54_7">Result</A> := <A HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_61_13">Next</A> (<A HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_81_27">Fld</A>, <A HREF="terminal_interface-curses-forms-field_types-user-choice__adb.htm#ref_55_7">Udf</A>.<b>all</b>);
      <b>return</b> <A HREF="terminal_interface-curses__ads.htm#ref_2099_9">Curses_Bool</A> (Boolean'Pos (<A HREF="terminal_interface-curses-forms-field_types-user-choice__adb.htm#ref_54_7">Result</A>));
   <b>end</b> <A HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_81_13">Generic_Next</A>;

   <b>function</b> <span class="symbol"><A NAME="ref_63_13" HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_88_13">Generic_Prev</A></span> (<span class="symbol"><A NAME="ref_63_27" HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_88_27">Fld</A></span> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_52_9">Field</A>;
                          <span class="symbol"><A NAME="ref_64_27" HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_89_27">Usr</A></span> : System.Address) <b>return</b> <A HREF="terminal_interface-curses__ads.htm#ref_2099_9">Curses_Bool</A>
   <b>is</b>
      <span class="symbol"><A NAME="ref_66_7">Result</A></span> : Boolean;
      <span class="symbol"><A NAME="ref_67_7">Udf</A></span>    : <b>constant</b> <A HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_58_9">User_Defined_Field_Type_With_Choice_Access</A> :=
        <A HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_58_9">User_Defined_Field_Type_With_Choice_Access</A>
        (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_217_9">Argument_Access</A> (Argument_Conversions.To_Pointer (<A HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_89_27">Usr</A>)).<b>all</b>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_213_7">Typ</A>);
   <b>begin</b>
      <A HREF="terminal_interface-curses-forms-field_types-user-choice__adb.htm#ref_66_7">Result</A> := <A HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_68_13">Previous</A> (<A HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_88_27">Fld</A>, <A HREF="terminal_interface-curses-forms-field_types-user-choice__adb.htm#ref_67_7">Udf</A>.<b>all</b>);
      <b>return</b> <A HREF="terminal_interface-curses__ads.htm#ref_2099_9">Curses_Bool</A> (Boolean'Pos (<A HREF="terminal_interface-curses-forms-field_types-user-choice__adb.htm#ref_66_7">Result</A>));
   <b>end</b> <A HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_88_13">Generic_Prev</A>;

   <span class="comment"><EM>--  -----------------------------------------------------------------------</EM></span>
   <span class="comment"><EM>--</EM></span>
   <b>function</b> <span class="symbol"><A NAME="ref_77_13" HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_79_13">C_Generic_Choice</A></span> <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_133_9">C_Field_Type</A>
   <b>is</b>
      <span class="symbol"><A NAME="ref_79_7">Res</A></span> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_70_9">Eti_Error</A>;
      <span class="symbol"><A NAME="ref_80_7">T</A></span>   : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_133_9">C_Field_Type</A>;
   <b>begin</b>
      <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_143_4">M_Generic_Choice</A> = <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_135_4">Null_Field_Type</A> <b>then</b>
         <A HREF="terminal_interface-curses-forms-field_types-user-choice__adb.htm#ref_80_7">T</A> := <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_223_13">New_Fieldtype</A> (<A HREF="terminal_interface-curses-forms-field_types-user__ads.htm#ref_82_13">Generic_Field_Check</A>'<b>Access</b>,
                             <A HREF="terminal_interface-curses-forms-field_types-user__ads.htm#ref_89_13">Generic_Char_Check</A>'<b>Access</b>);
         <b>if</b> <A HREF="terminal_interface-curses-forms-field_types-user-choice__adb.htm#ref_80_7">T</A> = <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_135_4">Null_Field_Type</A> <b>then</b>
            <b>raise</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_288_4">Form_Exception</A>;
         <b>else</b>
            <A HREF="terminal_interface-curses-forms-field_types-user-choice__adb.htm#ref_79_7">Res</A> := <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_228_13">Set_Fieldtype_Arg</A> (<A HREF="terminal_interface-curses-forms-field_types-user-choice__adb.htm#ref_80_7">T</A>,
                                      <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_163_13">Make_Arg</A>'<b>Access</b>,
                                      <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_168_13">Copy_Arg</A>'<b>Access</b>,
                                      <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_173_14">Free_Arg</A>'<b>Access</b>);
            <A HREF="terminal_interface-curses-aux__ads.htm#ref_87_14">Eti_Exception</A> (<A HREF="terminal_interface-curses-forms-field_types-user-choice__adb.htm#ref_79_7">Res</A>);

            <A HREF="terminal_interface-curses-forms-field_types-user-choice__adb.htm#ref_79_7">Res</A> := <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_235_13">Set_Fieldtype_Choice</A> (<A HREF="terminal_interface-curses-forms-field_types-user-choice__adb.htm#ref_80_7">T</A>,
                                         <A HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_81_13">Generic_Next</A>'<b>Access</b>,
                                         <A HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_88_13">Generic_Prev</A>'<b>Access</b>);
            <A HREF="terminal_interface-curses-aux__ads.htm#ref_87_14">Eti_Exception</A> (<A HREF="terminal_interface-curses-forms-field_types-user-choice__adb.htm#ref_79_7">Res</A>);
         <b>end</b> <b>if</b>;
         <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_143_4">M_Generic_Choice</A> := <A HREF="terminal_interface-curses-forms-field_types-user-choice__adb.htm#ref_80_7">T</A>;
      <b>end</b> <b>if</b>;
      <b>pragma</b> Assert (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_143_4">M_Generic_Choice</A> /= <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_135_4">Null_Field_Type</A>);
      <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_143_4">M_Generic_Choice</A>;
   <b>end</b> <A HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_79_13">C_Generic_Choice</A>;

<b>end</b> <A HREF="terminal_interface__ads.htm#ref_43_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_48_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_46_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_45_41">Field_Types</A>.<A HREF="terminal_interface-curses-forms-field_types-user__ads.htm#ref_45_53">User</A>.<A HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_45_58">Choice</A>;
</PRE></BODY></HTML>
